home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Top 200 Programs
/
Top 200 Programs.iso
/
Bob8
/
THOMPSON
/
LIBERTY
/
PRODUCT
/
LB14W.EXE
/
GRAFDEMO.BAS
< prev
next >
Wrap
BASIC Source File
|
1996-01-22
|
2KB
|
95 lines
'This new version of grafdemo.bas takes advantage of the
'new !contents and !contents? commands, and it also uses
'an empty edit menu to place the default edit menu after
'File on the menu bar (a new LB feature).
nomainwin
texteditor #main.text, 10, 10, 175, 200
menu #main, "&File", "&Open File", [load], "&Save File", [save], "&Print Text", [print], |, "E&xit Grafdemo", [quit]
menu #main, "edit"
menu #main, "&Action", "&Draw Graphic", [go]
WindowWidth = 500 : WindowHeight = 265
open "Graf Demo" for graphics_nsb as #main
print #main, "when leftButtonDown [getPoint]"
print #main, "trapclose [quit]"
[inputLoop]
input r$
goto [inputLoop]
[go]
print #main.text, "!lines" ;
input #main.text, lines
print #main, "cls" ;
for x = 1 to lines
print #main.text, "!line " ; x ;
input #main.text, line$
if word$( line$, 1 ) = "times" and x < lines then _
i = val(word$(line$, 2)) : _
x = x + 1 : _
print #main.text, "!line "; x ; : _
input #main.text, line$ : _
for x = 1 to i : _
print #main, line$ : _
next x : _
goto [skip]
print #main, line$ ;
[skip]
next x
print #main, "flush" ;
goto [inputLoop]
[getPoint]
print #main.text, "place " ; MouseX ; " " ; MouseY
goto [inputLoop]
[load]
filedialog "Load GrafDemo Text", "*.gdt", fname$
if fname$ = "" then [inputLoop]
open fname$ for input as #1
line$ = input$(#1, lof(#1))
print #main.text, "!contents line$";
close #1
goto [inputLoop]
[save]
filedialog "Save GrafDemo Text", "*.gdt", fname$
if fname$ = "" then [inputLoop]
open fname$ for output as #1
print #main.text, "!contents?";
input #main.text, line$
print #1, line$
close #1
goto [inputLoop]
[print]
print #main.text, "!lines";
input #main.text, lineCount
for x = 1 to lineCount
print #main.text, "!line "; x ;
input #main.text, lineOfText$
lprint lineOfText$
next x
dump
goto [inputLoop]
[quit] 'exit grafdemo.bas
close #main
end